{# Copyright 2014-2015 Siemens AG

   Copying and distribution of this file, with or without modification,
   are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
   This file is offered as-is, without any warranty.
#}
{% extends "include/base.html.twig" %}
{% block styles %}
{{ parent() }}
<link rel="stylesheet" type="text/css" href="css/select2.min.css"/>
<link rel="stylesheet" type="text/css" href="css/select2.custom.css"/>
{% endblock %}
{% block content %}
  <p>
    {{ 'To manage your own group permissions go into'| trans }}
    <b>Admin &gt; Groups &gt; Manage Group Users</b>.
    {{ 'To manage permissions for this one upload, go to'| trans }}
    <b>Admin &gt; Upload Permissions</b>.
  </p>
  {% block description %}
  {% endblock %}
  <form enctype="multipart/form-data" method="post">
      <input type="hidden" name="{{ uploadFormBuildParameterName }}" value="{{ uploadFormBuild }}"/>
    <ol>
      <li>
        <div class="form-group">
          <label for="{{ folderParameterName }}">{{ 'Select the folder for storing the uploaded files'| trans }}:</label>
            <br/>
            {% include 'components/select-folder.html.twig' with {'name': folderParameterName} %}
        </div>
      </li>
      {% block fileselect %}
      {% endblock %}
      <li>
        <div class="form-group">
          <label for="{{ fileInputName }}">({{ 'Optional'|trans }}) {{ 'Enter a description of this file'| trans }}:</label>
          <input type="text" class="form-control" style="width:40%;" name="{{ descriptionInputName }}" value="{{ descriptionInputValue }}">
        </div>
      </li>
      <li>
        <div class="form-group">
          <input type="checkbox" class="browse-upload-checkbox view-license-rc-size" name="scm" value="1"/>
          {{ 'Ignore SCM files (Git, SVN, TFS) and files with particular Mimetype'| trans }}
          <img src="images/info_16.png" data-toggle="tooltip" title="{{'Configure mimetypes from Admin-Customize-Skip MimeTypes from scanning'|trans}}" alt="" class="info-bullet"/>
        </div>
      </li>
      <li>
        <div class="form-group">
          <input type="radio" class="browse-upload-checkbox view-license-rc-size" name="public" value="private" {% if uploadVisibility == "private" %} checked="checked" {% endif %}/>
          {{ 'Visible only for active group'| trans }}
          <img src="images/info_16.png" data-toggle="tooltip" title="{{'which is the currently selected group'|trans}}" alt="" class="info-bullet"/><br/>

          <input type="radio" class="browse-upload-checkbox view-license-rc-size" name="public" value="protected" checked="checked" {% if uploadVisibility == "protected" %} checked="checked" {% endif %}/>
          {{ 'Visible for all groups'| trans }}
          <img src="images/info_16.png" data-toggle="tooltip" title="{{'which are accessible by you now'|trans}}" alt="" class="info-bullet"/><br/>

          <input type="radio" class="browse-upload-checkbox view-license-rc-size" name="public" value="public" {% if uploadVisibility == "public" %} checked="checked" {% endif %}/>
          {{ 'Make Public'| trans }}
          <img src="images/info_16.png" data-toggle="tooltip" title="{{'visible for all users'|trans}}" alt="" class="info-bullet"/><br/>
        </div>
      </li>
      {% if agentCheckBoxMake %}
      <li>
        <div class="form-group">
          <label for="agentCheckboxes">{{ 'Select optional analysis'| trans }}:</label>
          <br/>
          {{ agentCheckBoxMake }}
        </div>
      </li>
      {% endif %}
      {% for aContent in parmAgentContents %}
        {{ aContent }}
      {% endfor %}
    </ol>
    <p>
      {% block uploadText %}
      {% endblock %}
    </p>

    <input type="submit" class="btn btn-default btn-sm" value="{{ 'Upload'| trans }}"/>
    </div>
  </form>

{% endblock %}

{% block foot %}
  {{ parent() }}
  <script src="scripts/tools.js" type="text/javascript"></script>
  <script type="text/javascript">
    $(document).ready(function () {
      $('[data-toggle="tooltip"]').tooltip();
      $('#uploadToReuse').select2({
          "placeholder": "Select upload to reuse"
      });
    });
  </script>
  {% for aFoot in parmAgentFoots %}
    <script type="text/javascript">{{ aFoot }}  </script>
  {% endfor %}
{% endblock %}
